ihelpuoo.ErrorItem = function(msg,type)
{
	this.message = (msg?msg:null);
	this.type = "error";
}

ihelpuoo.ErrorItem.prototype
=
{
	valueOf: function(ele)
	{
		this.message = ihelpuoo.xml.getText(ele);
		this.type = ihelpuoo.xml.getAttribute(ele,"type","error");
	}
	
	,
	dump: function()
	{
		return "Error: " + this.message;
	}
	
	,isError: function(){return "error"==this.type;}
	,isWarn: function(){return "warn"==this.type;}
}

ihelpuoo.ErrorList = function(ele)
{
	if(ele)
		this.valueOf(ele);
	else
	{
		this.list = new Array();
		this.status = "Unknow";
	}
}

ihelpuoo.ErrorList.prototype
=
{
	valueOf: function(ele)
	{
		if(this.list)
			delete this.list;
		this.list = new Array();
		this.status = ihelpuoo.xml.getAttribute(ele,"status")
		var eNodes = ele.getElementsByTagName("ERROR");
		for(var i=0;i<eNodes.length;i++)
		{
			var e = new ihelpuoo.ErrorItem();
			e.valueOf(eNodes[i]);
			this.list.push(e);
		}
	}
	
	,
	addError: function(msg,type)
	{
		var e = new ihelpuoo.ErrorItem(msg,type);
		this.list.push(e);
	}
	
	,
	size: function()
	{
		if(this.list==null)return 0;
		return this.list.length;
	}
}